package com.jiazhong.shixi.pauline_bookstore.mapper;

import com.jiazhong.shixi.pauline_bookstore.bean.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("select * from `user` where username=#{username}  and `password`=md5(#{password});")
    User login(User user);
    @Insert("insert into `user` values(null,#{username},md5(#{password}),#{phone},#{email},#{address},1,now(),null,0)")
    int add(User user);
}
